/*
 * Copyright (c) 2020, Renesas Electronics Corporation. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
/**********************************************************************************************************************
 * File Name    : tzc_400.c
 * Version      : 1.0
 * Description  : TZC-400 driver.
 *********************************************************************************************************************/
/**********************************************************************************************************************
 * History : DD.MM.YYYY Version  Description
 *         : 01.09.2020 1.00     First Release
 *********************************************************************************************************************/

/**********************************************************************************************************************
 Includes   <System Includes> , "Project Includes"
 *********************************************************************************************************************/
#if 0
#include "iodefine.h"
#include "gpio_iodefine.h"
#endif
#include "tzc_400_iodefine.h"

/**********************************************************************************************************************
 Macro definitions
 *********************************************************************************************************************/

/**********************************************************************************************************************
 Local Typedef definitions
 *********************************************************************************************************************/

/**********************************************************************************************************************
 Exported global variables
 *********************************************************************************************************************/

/**********************************************************************************************************************
 Private (static) variables and functions
 *********************************************************************************************************************/

/**********************************************************************************************************************
 * Function Name: init_tzc_400_spimulti
 * Description  : Initialize TAC-400 for using SRAM and SPI.
 * Arguments    : none.
 * Return Value : none.
 *********************************************************************************************************************/
void init_tzc_400_spimulti(void)
{
    /*** Initialize SPI Multi ***/
    TZC_RGN_ATTR_SPI   = TZC_RGN_ATTR_EN_ALLFLT;

    TZC_RGN_ID_ACC_SPI = TZC_RGN_ID_ACC_EN_RDWR_NSAID0_1;

    TZC_GATE_KEEP_SPI  = TZC_GATE_KEEP_OPEN_ALLFLT;

    TZC_SPECUL_CTL_SPI = TZC_SPECUL_DIS_PREFETCH;

    /*** Initialize DDR ***/
    TZC_RGN_ATTR_TZCDDR   = TZC_RGN_ATTR_EN_ALLFLT;

    TZC_RGN_ID_ACC_TZCDDR = TZC_RGN_ID_ACC_EN_RDWR_NSAID0_1;

    TZC_GATE_KEEP_TZCDDR  = TZC_GATE_KEEP_OPEN_ALLFLT;

    TZC_SPECUL_CTL_TZCDDR = TZC_SPECUL_DIS_PREFETCH;;
}
/**********************************************************************************************************************
 * End of function init_tzc_400_spimulti
 *********************************************************************************************************************/

